package com.github_Dididipapa.shortlink.project.service;

import cn.hutool.http.server.HttpServerRequest;
import cn.hutool.http.server.HttpServerResponse;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github_Dididipapa.shortlink.project.dao.entity.Link;
import com.github_Dididipapa.shortlink.project.dto.req.*;
import com.github_Dididipapa.shortlink.project.dto.resp.*;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;

import java.io.IOException;
import java.util.Date;
import java.util.List;

public interface LinkService extends IService<Link> {
    LinkCreateRespDTO createLink(LinkReqDTO linkReqDTO);

    IPage<PageRespDTO> pageLink(PageReqDTO requestParam);

    void updateLink(LinkUpdateReqDTO linkReqDTO);

    void createLinkBatch(LinkBatchReqDTO linkBatchReqDTO);

    String getTitle(String url);

    void recycleBinSave(RecycleBinLinkReqDTO recycleBinLinkReqDTO);

    IPage<RecyleBinRespDTO> pageRecycleBinLink(RecycleBinPageReqDTO requestParam);

    void recoverLink(RecycleBinLinkReqDTO recycleBinLinkReqDTO);

    void removeLink(RecycleBinLinkReqDTO recycleBinLinkReqDTO);

    List<LinkGroupCountRespDTO> listGroupShortLinkCount(List<String> reqestParams);

    void routerLink(
            String shortLinkUri, ServletRequest request, ServletResponse response
    ) throws IOException;
}